﻿<%@ Page Language="C#" MasterPageFile="~/Site.master" CodeBehind="List.aspx.cs" Inherits="SRS_CP.List" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<%@ Register src="~/DynamicData/Content/GridViewPager.ascx" tagname="GridViewPager" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

  <div class="SRS_PageLayout">

      <br />

    <asp:DynamicDataManager ID="DynamicDataManager1" runat="server" AutoLoadForeignKeys="True">
        <DataControls>
            <asp:DataControlReference ControlID="GridView1" />
        </DataControls>
    </asp:DynamicDataManager>
   
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>

                <asp:DynamicValidator runat="server" ID="GridViewValidator" ControlToValidate="GridView1" Display="None" Cssclass="SRSValidator" />

                <asp:QueryableFilterRepeater runat="server" ID="FilterRepeater">
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("DisplayName") %>' OnPreRender="Label_PreRender" />
                        <asp:DynamicFilter runat="server" ID="DynamicFilter" />
                    </ItemTemplate>
                </asp:QueryableFilterRepeater>
            
<%-- ########################################################################################################################## --%>

                <asp:GridView ID="GridView1" runat="server" 
                    DataSourceID="GridDataSource" 
                    DataKeyNames="ID"
                    AutoGenerateColumns="False" AllowPaging="True" AllowSorting="True"  
                    EditRowStyle-BackColor="#FFFFFF" EditRowStyle-BorderStyle="Groove"
                    RowStyle-CssClass="td" HeaderStyle-CssClass="th" CellPadding="4" 
                    Cssclass="SRSGridView">
               
                     <Columns>

                         <asp:CommandField ShowEditButton="True" ButtonType="Image"
                             UpdateImageUrl='../images/check.png'
                             EditImageUrl='../images/pen.png'
                             CancelImageUrl="../images/cancel.png"
                             ItemStyle-HorizontalAlign="Center"
                             ItemStyle-Wrap="False" />

                    <asp:BoundField DataField="ID" HeaderText="ID" HeaderStyle-Height="25px" ReadOnly ="True" SortExpression="ID" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" ItemStyle-Height="23px"/>
                    <asp:BoundField DataField="RequestType" HeaderText="RequestType" ReadOnly="True" SortExpression="RequestType" />
                    <asp:BoundField DataField="Priority" HeaderText="Priority" SortExpression="Priority" ControlStyle-Width="97%" ControlStyle-BackColor="#F2F2F2" ControlStyle-BorderColor="#F2F2F2" ControlStyle-BorderStyle="Groove" ApplyFormatInEditMode="True" />
                    <asp:BoundField DataField="Disposition" HeaderText="Disposition" SortExpression="Disposition" ControlStyle-Width="97%" ControlStyle-BackColor="#F2F2F2" ControlStyle-BorderColor="#F2F2F2" ControlStyle-BorderStyle="Groove" ApplyFormatInEditMode="True" />
                    <asp:BoundField DataField="WorkStatus" HeaderText="WorkStatus" SortExpression="WorkStatus" ControlStyle-Width="97%"  ControlStyle-BackColor="#F2F2F2" ControlStyle-BorderColor="#F2F2F2" ControlStyle-BorderStyle="Groove" ApplyFormatInEditMode="True" />
                    <asp:BoundField DataField="Assignee" HeaderText="Assignee" SortExpression="Assignee"  ControlStyle-Width="97%" ControlStyle-BackColor="#F2F2F2" ControlStyle-BorderColor="#F2F2F2" ControlStyle-BorderStyle="Groove" ApplyFormatInEditMode="True" />
                    <asp:BoundField DataField="Submitted" HeaderText="Submitted" ControlStyle-Width="97%" ReadOnly="True" SortExpression="Submitted" FooterStyle-HorizontalAlign="NotSet" ItemStyle-HorizontalAlign="Center" />

                </Columns>

                <%--<asp:TemplateField HeaderText="Assignee">
                         <ItemTemplate>
                             <asp:Label ID="lblAssignee" runat="server" Text='<%# Eval("Assignee")%>'></asp:Label>
                         </ItemTemplate>
                    <EditItemTemplate>
                         <asp:Label ID="lblAssignee" runat="server" Text='<%# Eval("Assignee")%>' Visible="false"></asp:Label>
                         <asp:DropDownList ID="ddlAssignees" runat="server">
                         </asp:DropDownList>
                    </EditItemTemplate>
                    </asp:TemplateField> 
              --%>

<%-- ########################################################################################################################## --%>

                <HeaderStyle CssClass="th" />

                <PagerStyle Cssclass="SRSFooter"/>        
                
                <PagerTemplate>
                    <asp:GridViewPager ID="GridViewPager1" runat="server" Visible="true" />
                </PagerTemplate>

                <EmptyDataTemplate>
                    There are currently no items in this table.
                </EmptyDataTemplate>

                    <RowStyle CssClass="td" />

            </asp:GridView>

            <asp:EntityDataSource ID="GridDataSource" runat="server" ConnectionString="name=SRSRemoteEntities" DefaultContainerName="SRSRemoteEntities" EnableFlattening="True" EntitySetName="Requests" EntityTypeFilter="Request" EnableDelete="True" EnableInsert="True" EnableUpdate="True" />
            
            <asp:QueryExtender TargetControlID="GridDataSource" ID="GridQueryExtender" runat="server">
                <asp:DynamicFilterExpression ControlID="FilterRepeater" />
            </asp:QueryExtender>
        </ContentTemplate>
    </asp:UpdatePanel>
  </div>
</asp:Content>

